package com.google.common.util.service.life.practice;

/**
 * User: wujun
 * Date: 2014/7/29
 */
public class Main {

    public static int run(String[] args) throws InterruptedException {
        MyScheduledService myScheduledService = new MyScheduledService();
        myScheduledService.start();
        Thread.sleep(3000);
        myScheduledService.stop();
        System.out.println(myScheduledService.state());
        System.out.println("stop");
        Thread.sleep(2000);
        myScheduledService.stopAndWait();
        System.out.println(myScheduledService.state());
        System.out.println("stopAndWait");
        return 0;
    }

    public static void main(String[] args) throws InterruptedException {
        System.exit(run(args));
    }
}
